<!DOCTYPE html>
<!--
* CoreUI - Free Bootstrap Admin Template
* @version v2.0.0
* @link https://coreui.io
* Copyright (c) 2018 creativeLabs Łukasz Holeczek
* Licensed under MIT (https://coreui.io/license)
-->

<html lang="en">

<head>
  <base href="./">
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
  <meta name="description" content="CoreUI - Open Source Bootstrap Admin Template">
  <meta name="author" content="Łukasz Holeczek">
  <meta name="keyword" content="Bootstrap,Admin,Template,Open,Source,jQuery,CSS,HTML,RWD,Dashboard">
  <title>CoreUI Free Bootstrap Admin Template</title>
  <!-- Icons-->
  <link href="vendors/@coreui/icons/css/coreui-icons.min.css" rel="stylesheet">
  <link href="vendors/flag-icon-css/css/flag-icon.min.css" rel="stylesheet">
  <link href="vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
  <link href="vendors/simple-line-icons/css/simple-line-icons.css" rel="stylesheet">
  <!-- Main styles for this application-->
  <link href="css/style.css" rel="stylesheet">
  <link href="vendors/pace-progress/css/pace.min.css" rel="stylesheet">
  <style>
    html,
    body {
      width: 100%;
      height: 100%;
    }

    .table1 {
      width: 100%;
      height: 100%;
      margin: 50px 0px 0px 0px;
    }

    .mean {
      margin: 50px 0px 0px 0px;
    }

    [v-cloak] {
      display: none;
    }
  </style>

</head>

<body class="app header-fixed sidebar-fixed aside-menu-fixed sidebar-lg-show">
  <div align="center">
    <div class="head">
      <header class="app-header navbar">
        <button class="navbar-toggler sidebar-toggler d-lg-none mr-auto" type="button" data-toggle="sidebar-show">
          <span class="navbar-toggler-icon"></span>
        </button>
        <a class="navbar-brand" href="#">
          <img class="navbar-brand-full" src="img/brand/logo.svg" width="89" height="25" alt="CoreUI Logo">
          <img class="navbar-brand-minimized" src="img/brand/sygnet.svg" width="30" height="30" alt="CoreUI Logo">
        </a>
        <button class="navbar-toggler sidebar-toggler d-md-down-none" type="button" data-toggle="sidebar-lg-show">
          <span class="navbar-toggler-icon"></span>
        </button>
        <ul class="nav navbar-nav d-md-down-none">
          <li class="nav-item px-3">
            <a class="nav-link" href="#">Dashboard</a>
          </li>
          <li class="nav-item px-3">
            <a class="nav-link" href="#">Users</a>
          </li>
          <li class="nav-item px-3">
            <a class="nav-link" href="#">Settings</a>
          </li>
        </ul>
        <ul class="nav navbar-nav ml-auto">
          <li class="nav-item d-md-down-none">
            <a class="nav-link" href="#">
              <i class="icon-bell"></i>
              <span class="badge badge-pill badge-danger">5</span>
            </a>
          </li>
          <li class="nav-item d-md-down-none">
            <a class="nav-link" href="#">
              <i class="icon-list"></i>
            </a>
          </li>
          <li class="nav-item d-md-down-none">
            <a class="nav-link" href="#">
              <i class="icon-location-pin"></i>
            </a>
          </li>
          <li class="nav-item dropdown">
            <a class="nav-link" data-toggle="dropdown" href="#" role="button" aria-haspopup="true"
              aria-expanded="false">
              <img class="img-avatar" src="img/avatars/6.jpg" alt="admin@bootstrapmaster.com">
            </a>
            <div class="dropdown-menu dropdown-menu-right">
              <div class="dropdown-header text-center">
                <strong>Account</strong>
              </div>
              <a class="dropdown-item" href="#">
                <i class="fa fa-bell-o"></i> Updates
                <span class="badge badge-info">42</span>
              </a>
              <a class="dropdown-item" href="#">
                <i class="fa fa-envelope-o"></i> Messages
                <span class="badge badge-success">42</span>
              </a>
              <a class="dropdown-item" href="#">
                <i class="fa fa-tasks"></i> Tasks
                <span class="badge badge-danger">42</span>
              </a>
              <a class="dropdown-item" href="#">
                <i class="fa fa-comments"></i> Comments
                <span class="badge badge-warning">42</span>
              </a>
              <div class="dropdown-header text-center">
                <strong>Settings</strong>
              </div>
              <a class="dropdown-item" href="#">
                <i class="fa fa-user"></i> Profile</a>
              <a class="dropdown-item" href="#">
                <i class="fa fa-wrench"></i> Settings</a>
              <a class="dropdown-item" href="#">
                <i class="fa fa-usd"></i> Payments
                <span class="badge badge-secondary">42</span>
              </a>
              <a class="dropdown-item" href="#">
                <i class="fa fa-file"></i> Projects
                <span class="badge badge-primary">42</span>
              </a>
              <div class="divider"></div>
              <a class="dropdown-item" href="#">
                <i class="fa fa-shield"></i> Lock Account</a>
              <a class="dropdown-item" href="#">
                <i class="fa fa-lock"></i> Logout</a>
            </div>
          </li>
        </ul>
        <button class="navbar-toggler aside-menu-toggler d-md-down-none" type="button" data-toggle="aside-menu-lg-show">
          <span class="navbar-toggler-icon"></span>
        </button>
        <button class="navbar-toggler aside-menu-toggler d-lg-none" type="button" data-toggle="aside-menu-show">
          <span class="navbar-toggler-icon"></span>
        </button>
      </header>
    </div>
    <div class="mean">
      <ol class="breadcrumb">
        <li class="breadcrumb-item">Home</li>
        <li class="breadcrumb-item">
          <a href="#">Admin</a>
        </li>
        <li class="breadcrumb-item active">Dashboard</li>

        <li class="breadcrumb-menu d-md-down-none">
          <div class="btn-group" role="group" aria-label="Button group">
            <a class="btn" href="#">
              <i class="icon-speech"></i>
            </a>
            <a class="btn" href="./">
              <i class="icon-graph"></i> &nbsp;Dashboard</a>
            <a class="btn" href="#">
              <i class="icon-settings"></i> &nbsp;Settings</a>
          </div>
        </li>
      </ol>
    </div>
    <div class="table1">
      <div class="col-lg-9" id="im">
        <div class="card" id="card" align="left">
          <div class="card-header" id="card-header">
            <i class="fa fa-align-justify"></i>信息管理
            <div class="card-header-actions">
              <button class="btn  btn-link" type="button" data-toggle="modal" data-target="#primaryModal1"
                style="color:#73818f"> <i class="icons icon-plus"></i>&nbsp; 新增</button>
              <button class="btn  btn-link" type="button" data-toggle="modal" data-target="#dangerModal1" id="removerow"
                style="color:#73818f">
                <i class="icons cui-trash" onclick="delAll()"></i>&nbsp;删除 </button>
            </div>
          </div>

          <div class="card-body" id="itemsTemplate" v-cloak>
            <table class="table table-responsive-sm table-bordered">
              <thead>
                <tr>
                  <th width="100p"><input type="checkbox" id="cb" onclick="selectAll()" /><a
                      href="javascript:paixu()">id</a></th>
                  <th>用户名</th>
                  <th>注册时间</th>
                  <th>角色</th>
                  <th>状态</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody id="list">
                <tr v-for="(item, index) in items " :key="index" v-show="index<page1*5 && index>=(page1-1)*5">
                  <td>
                      <input type="checkbox"  v-model="item.ifcheck" id="checkbox1" name="checkbox1" v-on:click="chooseAll(index)"/>
                    #{{item.id}}
                  </td>
                  <td>{{item.name}}----{{index}}</td>
                  <td>{{item.registerDate}}</td>
                  <td>{{item.role}}</td>
                  <td>
                      <span class="badge badge-success" v-if="item.status === '激活'">{{item.status}}</span>
                      <span class="badge badge-danger" v-if="item.status === '禁用'">{{item.status}}</span>
                  <td>
                    <button class="btn btn-primary mb-1" type="button" v-on:click="choose1(index)" data-toggle="modal"
                      data-target="#primaryModal">编辑</button>
                    <button class="btn btn-danger mb-1" type="button" v-on:click="choose(index)" data-toggle="modal"
                      data-target="#dangerModal">删除</button>
                  </td>
                </tr>
              </tbody>
            </table>
            <div>
              <ul class="pagination">
                <li class="page-item">
                  <a class="page-link" href="javascript:app.last()">上一页</a>
                </li>
                <li class="page-item">
                  <a class="page-link" href="javascript:app.Next()">下一页</a>
                </li>
                <li class="page-item">
                  <a class="page-link" style="color:cornflowerblue">{{page1}}/{{page}}</a>
                </li>
                <li>
                  &nbsp;&nbsp;&nbsp;&nbsp;
                </li>
                <li class="page-item">
                  <input class="form-control" id="page_1" size="16" type="text" style="width:60px"
                    onkeyup="this.value=this.value.replace(/\D/g,'')"
                    onafterpaste="this.value=this.value.replace(/\D/g,'')">
                </li>
                <li class="page-item">
                  <a class="page-link" href="javascript:app.go();">go</a>
                </li>
              </ul>

            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

  <!-- 新增框 -->
  <div class="modal fade show" id="primaryModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
    style="display: none; padding-right: 16px;">
    <div class="modal-dialog modal-primary" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <h4 class="modal-title">添加界面</h4>
          <button class="close" type="button" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">×</span>
          </button>
        </div>
        <div class="modal-body">
          <div class="card">
            <div class="card-header">
              <strong>修改</strong>
            </div>
            <div class="card-body">
              <div class="row">
                <div class="col-sm-12">
                  <div class="form-group">
                    <label for="name">用户名</label>
                    <input class="form-control" id="name" type="text" placeholder="必填项">
                  </div>
                </div>
              </div>

              <div class="row">
                <div class="col-sm-12">
                  <div class="form-group">
                    <label for="ccnumber">角色</label>
                    <select class="form-control" id="jues">
                      <option>学生</option>
                      <option>教师</option>
                    </select>
                  </div>
                </div>
              </div>
              <div class="row">
                <div class="col-sm-12">
                  <div class="form-group">
                    <label for="ccnumber">序号</label>
                    <input class="form-control" id="sno" type="text" placeholder="必填项">
                  </div>
                </div>
              </div>

            </div>
          </div>
        </div>
        <div class="modal-footer">
            <button class="btn btn-secondary" type="button" data-dismiss="modal">取消</button>
          <button class="btn btn-primary" type="button" onclick="Add()">添加</button>
        </div>
      </div>

    </div>

  </div>

  <!-- 编辑框 -->
  <div class="modal fade show" id="primaryModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
    style="display: none; padding-right: 16px;">
    <div class="modal-dialog modal-primary" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <h4 class="modal-title">编辑界面</h4>
          <button class="close" type="button" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">×</span>
          </button>
        </div>
        <div class="modal-body">
          <div class="card">
            <div class="card-header">
              <strong>修改</strong>
            </div>
            <div class="card-body">
              <div class="row">
                <div class="col-sm-12">
                  <div class="form-group">
                    <label for="name">用户名</label>
                    <input class="form-control" id="name1" type="text" placeholder="请输入名字" oninput="ifNULL(this)">
                  </div>
                </div>
              </div>

              <div class="row">
                <div class="col-sm-12">
                  <div class="form-group">
                    <label for="ccnumber">角色</label>
                    <select class="form-control" id="js1">
                      <option>学生</option>
                      <option>教师</option>
                    </select>
                  </div>
                </div>
              </div>


              <div class="row">
                <div class="col-sm-12">
                  <div class="form-group">
                    <label for="ccnumber">学号</label>
                    <input class="form-control" id="sno1" type="text"  disabled>
                  </div>
                </div>
              </div>

              

              <div class="row">
                <div class="col-sm-12">
                  <div class="form-group">
                    <label for="ccnumber">注册时间</label>
                    <input class="form-control" id="time1" type="text" disabled>
                  </div>
                </div>
              </div>
              <div align="center">
              <div class="form-check form-check-inline">
                  <input class="form-check-input" type="radio" name="inlineRadioOptions" id="activation" value="1">
                  <label class="form-check-label" for="inlineRadio1">激活</label>
                </div>
                <div class="form-check form-check-inline">
                  <input class="form-check-input" type="radio" name="inlineRadioOptions" id="prohibit" value="2">
                  <label class="form-check-label" for="inlineRadio2">禁用</label>
                </div>
                </div>>
            </div>
            
          </div>
        </div>
        <div class="modal-footer">
          <button class="btn btn-secondary" type="button" data-dismiss="modal">取消</button>
          <button class="btn btn-primary" type="button" id="primaryModalbutton" onclick="app.modify()">修改</button>
        </div>
      </div>

    </div>

  </div>

  <!-- 删除框 -->
  <div class="modal fade show" id="dangerModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
    style="display: none; padding-right: 16px;">
    <div class="modal-dialog modal-danger" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <h4 class="modal-title">确认删除</h4>
          <button class="close" type="button" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">×</span>
          </button>
        </div>
        <div class="modal-body">
          <p>是否确认删除</p>
        </div>
        <div class="modal-footer">
          <button class="btn btn-secondary" type="button" data-dismiss="modal">取消</button>
          <button class="btn" id="displayBtn" btn-danger" type="button" data-toggle="modal"
            data-target="#successModal">确认</button>
        </div>
      </div>
    </div>
  </div>

  <!-- 删除框2（群删） -->
  <div class="modal fade show" id="dangerModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
    style="display: none; padding-right: 16px;">
    <div class="modal-dialog modal-danger" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <h4 class="modal-title">确认删除</h4>
          <button class="close" type="button" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">×</span>
          </button>
        </div>
        <div class="modal-body">
          <p>是否确认删除</p>
        </div>
        <div class="modal-footer">
          <button class="btn btn-secondary" type="button" data-dismiss="modal">取消</button>
          <button class="btn" id="displayBtn" btn-danger" type="button" onclick="delAll()">确认</button>
        </div>
      </div>
    </div>

  </div>

  <!-- 警告框（群删） -->
  <div class="modal fade show" id="warning" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
    style="display: none; padding-right: 16px;">
    <div class="modal-dialog modal-danger" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <h4 class="modal-title">警告</h4>
          <button class="close" type="button" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">×</span>
          </button>
        </div>
        <div class="modal-body">
          <p>未指定选项，删除失败</p>
        </div>
        <div class="modal-footer">
          <button class="btn btn-secondary" type="button" data-dismiss="modal">确认</button>
        </div>
      </div>
    </div>

  </div>

  <!-- 警告框(不能为空) -->
  <div class="modal fade show" id="warning1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
    style="display: none; padding-right: 16px;">
    <div class="modal-dialog modal-danger" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <h4 class="modal-title">警告</h4>
          <button class="close" type="button" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">×</span>
          </button>
        </div>
        <div class="modal-body">
          <p>必填项 不能为空</p>
        </div>
        <div class="modal-footer">
          <button class="btn btn-secondary" type="button" data-dismiss="modal">确认</button>
        </div>
      </div>
    </div>
  </div>


  <!-- 成功提示框（群删） -->
  <div class="modal fade show" id="successModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
    style="display: none; padding-right: 16px;">
    <div class="modal-dialog modal-success" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <h4 class="modal-title">提示</h4>
          <button class="close" type="button" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">×</span>
          </button>
        </div>
        <div class="modal-body">
          <p>删除成功</p>
        </div>
        <div class="modal-footer">
          <button class="btn btn-secondary" type="button" data-dismiss="modal">确认</button>
        </div>
      </div>

    </div>

  </div>
  <script src="vendors/jquery/js/jquery.min.js"></script>
  <script src="vendors/popper.js/js/popper.min.js"></script>
  <script src="vendors/bootstrap/js/bootstrap.min.js"></script>
  <script src="vendors/pace-progress/js/pace.min.js"></script>
  <script src="vendors/perfect-scrollbar/js/perfect-scrollbar.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js"></script>
  <script src="js/mock-min.js"></script>

  <!-- <script>
    var tr;
    $("#displayBtn").click(function () {
      // var currentBtn = document.getElementById("#dangerModal");
      $('#dangerModal').modal('hide')
    }
    )
    $(".").click(function () {
      // var currentBtn = document.getElementById("#dangerModal");
      tr=
      $('#dangerModal').modal('hide')
    }
    )
  </script> -->
  <!-- <script type="text/javascript">
		// var btn = document.getElementById("displayBtn");
		// btn.onclick=function(){
    //   var currentBtn = document.getElementById("dangerModal");
    //   currentBtn.style.display = "none";
    //   var div1 = document.getElementsByClassName("modal-backdrop fade show")
    //   div1[0].style.display = "none";
		// }

  </script> -->

  <script type="text/javascript">
    //删除模态框确认事件
    $("#displayBtn").click(function () {
      $('#dangerModal').modal('hide');
      hellow();
      app.items.splice(app.idx, 1);
      if (app.items.length % 5 == 0) {
        app.page = parseInt(app.items.length / 5);
      } else {
        app.page = parseInt(app.items.length / 5 + 1);
      }

    }
    )

    function paixu() {
      if (app.paixu == 0) {
        app.paixu = 1;
        //正数交换
        app.items.sort(function (a, b) {
          return b.id - a.id;
        })
      }
      else {
        app.paixu = 0;
        app.items.sort(function (a, b) {
          return a.id - b.id;
        })
      }
    }
    //复选按钮事件
    function selectAll() {
      var cb = document.getElementById('cb');
      if (!cb.checked) {
        var checkbox = document.getElementsByName("checkbox1");

        for (var j = 0; j < checkbox.length; j++) {
          checkbox[j].checked = false;

        }
        for (var j = 0; j < app.items.length; j++) {
          app.items[j].ifcheck = false;
        }
        // cb.checked=false;
      }
      else {
        var checkbox = document.getElementsByName("checkbox1");
        for (var j = 0; j < checkbox.length; j++) {
          checkbox[j].checked = true;
        }
        for (var j = 0; j < app.items.length; j++) {
          app.items[j].ifcheck = true;
        }
        // cb.checked=true;
      }
    }

    //群删事件
    function delAll() {
      var cb = document.getElementById('cb');
      cb.checked = false;
      $('#dangerModal1').modal('hide');
      var a = 0;
      for (var j = 0; j < app.items.length; j++) {
        if (app.items[j].ifcheck == true) {
          app.items.splice(j, 1);
          j--;
          a = 1;
        }
      }
      var checkbox = document.getElementsByName("checkbox1");
      for (var j = 0; j < checkbox.length; j++) {
        checkbox[j].checked = false;
      }

      if (a == 1) {
        $('#successModal').modal('show');
        a = 0;
      }
      else {
        $('#warning').modal('show');
      }

      if (app.items.length % 5 == 0) {
        app.page = parseInt(app.items.length / 5);
      } else {
        app.page = parseInt(app.items.length / 5 + 1);
      }
    }

    //添加按钮事件
    function Add() {
      var sno = document.getElementById('sno');
      var name = document.getElementById('name');
      var js = document.getElementById('jues');
      if (sno.value.length == 0 || name.value.length == 0) {
        $('#warning1').modal('show');
        return;
      }
      $('#primaryModal1').modal('hide');
      var date = new Date();
      var year = date.getFullYear();
      var month = date.getMonth() + 1;
      var day = date.getDate();
      var hh = date.getHours();
      var mi = date.getMinutes();
      var ss = date.getSeconds();
      // var wk="星期"+"日一二三四五六".charAt(date.getDay());
      var time = year + "-" + month + "-" + day + " " + hh + ":" + mi +
        ":" + ss +
        " "; //+wk;
      var date = {
        id: sno.value,
        ifcheck: false,
        name: name.value,
        role: js.value,
        registerDate: time,
        status: "禁用"
      };


      app.items.push(date);
      // //当前表单清空
      name.value = "";
      sno.value = "";
      js.value = "学生";
    }


    //编辑判定
    function ifNULL(x){
      if(x.value.length==0){
        x.className="form-control is-invalid";
      }
      else{
        x.className="form-control is-valid";  
      }
    }

    //编辑关闭重置
    $('#primaryModal').on('hidden.bs.modal', function (e) {
      var input_1=document.getElementById("name1");
      input_1.className="form-control";    
    })

    //添加关闭重置
    $('#primaryModal1').on('hidden.bs.modal', function (e) {
      var sno = document.getElementById('sno');
      var name = document.getElementById('name');
      var js = document.getElementById('ccnumber');
      var year = document.getElementById('ccyear');
      var mouth = document.getElementById('ccmonth');
      var day = document.getElementById('cvv');

      name.value = "";
      sno.value = "";
      js.value = "";
      year.value = "2014";
      mouth.value = "1";
      day.value = "1"; 
    })

  </script>
  <script>
    var items = [];
    var app;
    $(function () {
      Mock.mock("http://127.0.0.1:5500/asd", {
        "data|16-20": [
          {
            id: "@increment()",
            // ifcheck:false,
            name: "@cname",
            "role|1": ["教师", "学生"],
            registerDate: "@datetime()",
            "status|1": ["激活", "禁用"]
          }],
        success: true,

        code: 200,
        msg: "Success"
      });
      $.getJSON("http://127.0.0.1:5500/asd", function (response) {
        items = response.data;
        for (var j = 0; j < items.length; j++) {
          items[j].ifcheck = false;
        }
        if (items.length % 5 == 0) {
          page = items.length / 5;
        } else {
          page = items.length / 5 + 1;
        }
        page = parseInt(page);
        //var page = items.length / 5;// == 0 ? (items / 5 ): (items / 5 + 1);
        app = new Vue({
          el: '#itemsTemplate',
          data: {
            items: items,
            page: page,
            page1: 1,
            paixu: 0,
            idx: 0
          },
          methods: {
            choose: function (index) {
              this.idx = index;
            },
            choose1: function (index) {
              this.idx = index;
              var name = document.getElementById('name1');
              var js = document.getElementById('js1');
              var sno = document.getElementById("sno1");
              var time = document.getElementById("time1");
              var activation=document.getElementById("activation");
              var prohibit=document.getElementById("prohibit");
              name.value = app.items[app.idx].name;
              js.value = app.items[app.idx].role;
              sno.value = app.items[app.idx].id;
              time.value = app.items[app.idx].registerDate;
              if(app.items[app.idx].status==="激活"){
                activation.checked=true;
              }else{
                prohibit.checked=true;
              }
            },
            hellow: function () {
              alert("asdas");
            },
            //编辑按钮事件
            modify: function () {
              var name = document.getElementById('name1');
              var js = document.getElementById('js1');
              var sno = document.getElementById("sno1");
              var time = document.getElementById("time1");
              var activation=document.getElementById("activation");
              var prohibit=document.getElementById("prohibit");
              if(!name.value.length){
                return;
              }

              $('#primaryModal').modal('hide');             
              this.items[app.idx].name = name.value;
              this.items[app.idx].role = js.value;
              this.items[app.idx].id = sno.value;
              this.items[app.idx].registerDate = time.value;
              if(activation.checked){
                this.items[app.idx].status="激活";
              }
              if(prohibit.checked){
                this.items[app.idx].status="禁用";
              }
            },
            //上一页
            last: function () {
              if (this.page1 != 1) {
                this.page1--;
              }
            },
            //下一页
            Next: function () {
              if (this.page1 != app.page) {
                this.page1++;
              }
            },
            //跳转目标页数
            go: function () {
              var page = document.getElementById('page_1');
              if (page.value.length == 0) return;
              if (page.value > app.page) { page.value = app.page; }
              app.page1 = page.value;
              page.value = "";
            },
            //是否全选
            chooseAll: function (index) {
              var cb = document.getElementById("cb");
              if (this.items[index].ifcheck == false) {
                this.items[index].ifcheck = true;
              }
              else {
                this.items[index].ifcheck = false;
              }
              for (var j = 0; j < this.items.length; j++) {
                if (this.items[j].ifcheck == false) {
                  cb.checked = false;
                  break;
                }
              }
            }
          }
        });
        return;
      });
    });




  </script>

</body>

</html>